package com.yyx.jupiter.controller;

import com.yyx.jupiter.entity.AblationReq;
import com.yyx.jupiter.service.ablation.AblationService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@Validated
@RequestMapping("/ablation")
public class AblationController {

    @Resource
    AblationService ablationService;

    @PostMapping(value = "/get_strategy")
    public String getStrategy(@RequestBody AblationReq ablationReq) throws Exception {
        return ablationService.getStrategy(ablationReq.getScene(), ablationReq.getAblationKey());
    }

    @PostMapping("/get_bucket_number")
    public Integer getBucketNumber(@RequestBody AblationReq ablationReq) throws Exception {
        return ablationService.getBucketNumber(
                ablationReq.getScene(),
                ablationReq.getAblationKey(),
                ablationReq.getBucketNumber());
    }
}
